﻿using System.Windows.Input;
using GalaSoft.MvvmLight.Command;
using Looptribe.Moodlin8.Model;

namespace Looptribe.Moodlin8.ViewModel
{
    public class TeacherViewModel : LoadingViewModel
    {
        private CourseUser _teacher;
        public CourseUser Teacher
        {
            set { Set(() => Teacher, ref _teacher, value); }
            get { return _teacher; }
        }

        public ICommand SendMessageCommand { get; private set; }

        public TeacherViewModel()
        {
            SendMessageCommand = new RelayCommand(ExecuteSendMessage);
        }

        private void ExecuteSendMessage()
        {
            Controller.GotoUserMessages(Teacher.ToUser());
        }

        public void LoadContent(CourseUser teacher)
        {
            Teacher = teacher;
        }
    }
}
